//第二层服务层

//引入持久层函数
const {add3,get3,delete3,getOne3,updataOne3,search3} = require('../dataBase/dao/adminDao');

module.exports.add2 = async function(data){
    return await add3(data);
}

module.exports.get2 = async function({searchType,searchValue,currentPage,pageSize}){
    if(searchValue){
        return await search3({searchType,searchValue,currentPage,pageSize});//将搜索数据发送三层
    }else{
        return await get3({currentPage,pageSize});
    }
    
}

module.exports.delete2 = async function(data){
    return await delete3(data);
}

module.exports.getOne2 = async function(data){
    return await getOne3(data);
}

module.exports.updataOne2 = async function(data){
    return await updataOne3(data);
}

